package com.xunk.common.core.annotation;


import com.xunk.common.core.interfaces.EnumValidateInterface;
import com.xunk.common.core.validator.EnumValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @ProjectName: HIM
 * @Package: com.xunk.equipment.annotation
 * @ClassName: EnumCheck
 * @Author: luanzhiwei
 * @Description: 枚举类校验
 * @Date: 2021/4/13 9:28
 * @Version: 1.0
 */
@Documented
@Target({ElementType.PARAMETER, ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
@Retention(value = RetentionPolicy.RUNTIME)
@Constraint(validatedBy = EnumValidator.class)
public @interface EnumCheck {

    //不符合校验格式后的提示
    String message() default "错误的枚举值";

    //校验分组
    Class<?>[] groups() default {};

    //有效负载
    Class<? extends Payload>[] payload() default {};

    //使用哪个枚举映射
    Class<? extends EnumValidateInterface> enableClass();

    //是否忽略空值
    boolean ignoreEmpty() default true;

}
